/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidad;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.*;
import entidad.Actor;

/**
 *
 * @author felipe
 */
@Entity
public class Movie {
    
    private Integer anno;
    


    

 
    
    private File cover;
    
    private String palabrasClave;
    
    private String genero;
    
    private double rating;
    
    private double duracion;
    
    private Boolean availableForRental;
    
    private Boolean availableForPurchase;
    
    @ManyToOne
    private Director director;
    
    
    @ManyToMany
    private List<Actor> actores = new ArrayList<Actor>();

    public List<Actor> getActores() {
        return actores;
    }

    public void setActores(List<Actor> actores) {
        this.actores = actores;
    }
    
    public String getGenero() {
        return genero;
    }

    public void setGenero(String genero) {
        this.genero = genero;
    }

    public Director getDirector() {
        return director;
    }

    public void setDirector(Director director) {
        this.director = director;
    }
    

    @Id
     @GeneratedValue(strategy=GenerationType.AUTO)
    private String nombre;
    
    public Movie(){
        
    }
    
    public Movie(Integer anno, File cover, String palabras, String gen, double rating, double duracion, Boolean dispo1, Boolean dispo2,String nombre, Director director, ArrayList<Actor> actores){
        this.anno= anno;
        this.cover=cover;
        this.palabrasClave=palabras;
        this.genero=gen;
        this.rating=rating;
        this.duracion=duracion;
        this.availableForRental=dispo1;
        this.availableForPurchase=dispo2;
        this.nombre=nombre;
        this.director=director;
        this.actores=actores;
    }

    public Integer getAnno() {
        return anno;
    }

    public void setAnno(Integer anno) {
        this.anno = anno;
    }

    public Boolean getAvailableForPurchase() {
        return availableForPurchase;
    }

    public void setAvailableForPurchase(Boolean availableForPurchase) {
        this.availableForPurchase = availableForPurchase;
    }

    public Boolean getAvailableForRental() {
        return availableForRental;
    }

    public void setAvailableForRental(Boolean availableForRental) {
        this.availableForRental = availableForRental;
    }

    public File getCover() {
        return cover;
    }

    public void setCover(File cover) {
        this.cover = cover;
    }

    public double getDuracion() {
        return duracion;
    }

    public void setDuracion(double duracion) {
        this.duracion = duracion;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getPalabrasClave() {
        return palabrasClave;
    }

    public void setPalabrasClave(String palabrasClave) {
        this.palabrasClave = palabrasClave;
    }

    public double getRating() {
        return rating;
    }

    public void setRating(double rating) {
        this.rating = rating;
    }
    
    public String path(){
        return this.cover.getPath();
    }

    @Override
    public String toString() {
        return this.nombre;
    }
    
    
    
    
}
